]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Always use AppSystem to lookup apps
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 14 Mar 2020 13:45:42 +0000 (14:45 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 14 Mar 2020 19:33:36 +0000 (20:33 +0100)
There is no good reason for bypassing the application cache in
AppSystem and loading .desktop files again.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1093

js/ui/appDisplay.js
js/ui/calendar.js

index 461a48682c7dea7833db57f16e31dc4b5f570758..62a99b9fe9925be7153588e2de21385072f96d25 100644 (file)
@@ -1251,8 +1251,8 @@ var AppSearchProvider = class AppSearchProvider {
         let results = [];
         groups.forEach(group => {
             group = group.filter(appID => {
-                let app = Gio.DesktopAppInfo.new(appID);
-                return app && app.should_show();
+                const app = this._appSys.lookup_app(appID);
+                return app && app.app_info.should_show();
             });
             results = results.concat(group.sort(
                 (a, b) => usage.compare(a, b)
index aa1c4558a5295f45dcd3f2460cfe2fe811607450..5b2e9477322fab36eaf66e26b549b73384ab3f52 100644 (file)
@@ -837,8 +837,9 @@ class EventsSection extends MessageList.MessageListSection {
         this._title.connect('clicked', this._onTitleClicked.bind(this));
         this._title.connect('key-focus-in', this._onKeyFocusIn.bind(this));
 
-        Shell.AppSystem.get_default().connect('installed-changed',
-                                              this._appInstalledChanged.bind(this));
+        this._appSys = Shell.AppSystem.get_default();
+        this._appSys.connect('installed-changed',
+            this._appInstalledChanged.bind(this));
         this._appInstalledChanged();
     }
 
@@ -933,9 +934,9 @@ class EventsSection extends MessageList.MessageListSection {
 
         let appInfo = this._getCalendarApp();
         if (appInfo.get_id() === 'org.gnome.Evolution.desktop') {
-            let app = Gio.DesktopAppInfo.new('evolution-calendar.desktop');
+            let app = this._appSys.lookup_app('evolution-calendar.desktop');
             if (app)
-                appInfo = app;
+                appInfo = app.app_info;
         }
         appInfo.launch([], global.create_app_launch_context(0, -1));
     }